package com.jtjt.parking.springactivitidemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;
import java.security.Principal;

@Controller
public class LoginController {

    @GetMapping("/authentication/login")
    public String authenticationLogin() throws IOException {
        return "login";
    }

    @GetMapping("/")
    @ResponseBody
    public String hello() {
        return "hello";
    }

    @GetMapping("/info")
    @ResponseBody
    public Object info(Principal principal) {
        return principal;
    }

}
